package com.bookmall.member.domain.vo;

import lombok.Data;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * 注册时采集的信息
 * @Author 胡菜鸡
 * @Create 2022-04-02-14:55
 */
@Data
@ToString
public class RegisterUserVo {
    @NotBlank(message = "昵称必须填写")
    private String nickname;

    @NotBlank(message = "性别必须填写")
    private String sex;

    @NotBlank(message = "学号必须填写")
    @Length(min = 6, max = 20, message = "学号必须为6-20位字符或数字")
    private String stuId;

    @NotBlank(message = "密码必须填写")
    @Length(min = 6, max = 18, message = "密码必须为6-18位字符或数字")
    private String password;

    @NotBlank(message = "手机号必须填写")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String phone;

    @NotBlank(message = "验证码必须填写")
    private String code;
}
